-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move ConfigOptions to core #4803
Conversation
datafusion/common/Cargo.toml
Outdated
@@ -47,3 +47,4 @@ object_store = { version = "0.5.0", default-features = false, optional = true } | |||
parquet = { version = "29.0.0", default-features = false, optional = true } | |||
pyo3 = { version = "0.17.1", optional = true } | |||
sqlparser = "0.29" | |||
num_cpus = "1.13.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only slight downside, but I'm inclined to think this isn't a big deal
ecd33fa
to
85aab58
Compare
85aab58
to
f852074
Compare
@@ -92,9 +92,12 @@ pub struct OptimizerContext { | |||
impl OptimizerContext { | |||
/// Create optimizer config | |||
pub fn new() -> Self { | |||
let mut options = ConfigOptions::default(); | |||
options.optimizer.filter_null_join_keys = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double-checked this wasn't introduced by the recent config rework, and confirmed that it has always been the case that OptimizerContext defaults this to true, but ConfigOptions defaults it to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was always to have this default to false so this looks like a bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OptimizerContext
is now only used within tests, and so I am going to leave this for now. If you feel strongly I can file a follow up PR to change this, but it creates a non-trivial amount of test-churn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👨🍳 👌
Looks very nice to me @tustvold -- thank you
@@ -17,7 +17,7 @@ | |||
|
|||
//! DataFusion Configuration Options | |||
|
|||
use datafusion_common::{DataFusionError, Result}; | |||
use crate::{DataFusionError, Result}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
) -> Result<Option<LogicalPlan>> { | ||
if !config.options().optimizer.filter_null_join_keys { | ||
return Ok(None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it is worth a debug!
here if this is skipped
@@ -91,28 +85,25 @@ pub struct OptimizerContext { | |||
/// Query execution start time that can be used to rewrite | |||
/// expressions such as `now()` to use a literal value instead | |||
query_execution_start_time: DateTime<Utc>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice
Benchmark runs are scheduled for baseline = ae1465d and contender = e1dc962. e1dc962 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Part of #4349
Rationale for this change
Moves
ConfigOptions
tocommon
so it can be used directly by the optimizer, planner, etc... greatly simplifying plumbing configuration around the placeWhat changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?